from qqbot import QQBotSlot as qqbotslot, RunBot

#指定用户，用昵称
buddylist = ['635','asd']
@qqbotslot
def onQQMessage(bot, contact, member, content):
	if contact.ctype == 'buddy':
		#接受指定好友的消息，并保存
		if contact.name in buddylist:
			with open ('content.txt','a',encoding='utf-8') as f:
				f.write(contact.name + ":" + content +"\n")
	if contact.ctype == 'buddy':
		#启动指令
		if content == '发送群发消息':
			mylist = bot.List('buddy')
			if mylist:
				for g in mylist:
					if g.name in buddylist:
						print([g, type(g), g.qq, g.name, g.uin, g.mark])
						#群发的消息
						bot.SendTo(g,"111222111")

if __name__ == '__main__':
	RunBot()

